home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d2
/
vampire2.arc
/
VAMPIRE.C
< prev
next >
Wrap
Text File
|
1989-04-28
|
2KB
|
77 lines
#include <stdio.h>
#define SEGMENT 0xf000
main(argc,argv)
int argc;
char *argv[];
{
static char Sccsid[] = "@(#)vampire.c 2.0 - Ryugen Fisher, 1987";
unsigned char file[16];
if(argc > 1)
{
printf(" vampire - sucks the BIOS rom contents out of the PC on which\n");
printf(" it is executed. The rom contents are placed into \n");
printf(" binary files named 'BIOS.ROM' and OTHER.ROM \n");
printf(" The contents of those files can then be HEX'd with \n");
printf(" ZAPLOAD by T. Jennings, HEX86 by Manx, or \n");
printf(" BIN2HEX by Robert Pasky \n");
printf(" version 2.0 by En-Crypts SoftSystems \n");
exit(0);
}
/*
** initialize
*/
printf("ROM contents are being copied to files BIOS8.ROM,\n");
printf("BIOS16.ROM, BIOS32.ROM, and OTHER.ROM\n");
/*
** extract bios rom contents starting at 'offset'
*/
strcpy(file,"BIOS8.ROM");
rom2file(file,0x2000,0xe000); /* where IBM-PC BIOS resides */
strcpy(file,"BIOS16.ROM");
rom2file(file,0x4000,0xe000); /* where IBM-PC BIOS resides */
strcpy(file,"BIOS32.ROM");
rom2file(file,0x8000,0xe000); /* where IBM-PC BIOS resides */
strcpy(file,"BIOS64.ROM");
rom2file(file,0x10000,0xe000); /* where IBM-PC BIOS resides */
strcpy(file,"OTHER.ROM");
rom2file(file,0x8000,0x6000); /* where basic is (if present) */
}
/*
** create a file containing the contents of the specified memory
*/
rom2file(fname,siz,off)
unsigned char *fname;
unsigned int off,siz;
{
register unsigned int size, offset;
FILE *ofd;
if((ofd = fopen(fname,"w")) == NULL)
{
printf("cannot create output file %s\n,fname");
exit(0);
}
size = siz;
offset = off;
printf("FILE <%s> contains %u bytes from %04x:%04x to %04x:%04x\n",
fname,size,SEGMENT,offset,SEGMENT,offset+(size-1));
for(;size;size--)
{
putc(peekbyte(offset++,SEGMENT),ofd);
}
fclose(ofd);
}